
class GroupRequestHandle
{
  int count = 0;
  Function()? group_final_notifications;
  GroupRequestHandle({this.group_final_notifications});
  void enter_request(){
    count++;
  }
  void leave_request() {
    count--;
    try {
      if (count < 0) throw Exception("enter_request和leave_request必须配对使用");
      if (count == 0 && group_final_notifications != null)
        group_final_notifications!();
    } catch (e) {
      print("e:$e");
    }
  }

}